<table width="100%">
  <tr>
    <td class="regulartext" style="text-align: right;">
      Användare:
    </td>
    <td class="regulartext" style="text-align: left;">
      <%= @user.username %>
    </td>
  </tr>
  <tr>
    <td class="regulartext" style="text-align: right;">
      Omdöme:
    </td>
    <td class="regulartext" style="text-align: left;">
      <% if @user.judgements.count > 0 %>
        <%= @user.judgement %>
      <% else %>
        Har inte fått några omdömen ännu.
      <% end %>
    </td>
  </tr>
  <% if @user.judgements.count > 0 %>
    <tr>
      <td class="regulartext" colspan="2">
        <table width="100%">
          <tr>
            <td class="regulartext">
              &nbsp;
            </td>
            <td class="regulartext">
              <%= @user.username %>:s kommentar
            </td>
            <td class="regulartext">
              Kommentar om <%= @user.username %>
            </td>
          </tr>
          <% @user.judgements.each do |j| %>
            <% if j.seller = @user %>
              <tr>
                <td class="regulartext">
                  Säljare
                </td>
                <td class="regulartext">
                  <%= j.seller_comment %><br/>
                  Betyg: <%= j.seller_judgement %>
                </td>
                <td class="regulartext">
                  <%= j.buyer_comment %><br/>
                  Betyg: <%= j.buyer_judgement %>
                </td>
              </tr>
            <% else %>
              <tr>
                <td class="regulartext">
                  Köpare
                </td>
                <td class="regulartext">
                  <%= j.buyer_comment %><br/>
                  Betyg: <%= j.buyer_judgement %>
                </td>
                <td class="regulartext">
                  <%= j.seller_comment %><br/>
                  Betyg: <%= j.seller_judgement %>
                </td>
              </tr>
            <% end %>
          <% end %>
        </table>
      </td>
    </tr>
  <%  end %>
</table>
